<template>
  <div class="hello">
    <h1>Hello World2: {{count}}</h1>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data() {
    return {
      count: 1
    }
  },
  created() {
    // !#3 通过 this.$bus.$on 监听事件
    this.$bus.$on('addCount', (count) => {
      this.count += count
    })
  }
}
</script>
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
